package com.summer.LanQiao;

public class _04 {
    public static void main(String[] args) {
        int x = 1000;
        String x2 = Integer.toString(x,2);
        char[] chars = x2.toCharArray();
        System.out.println(x2);
        int count = 0 ;
        for (int i = 0; i <chars.length ; i++) {
            if (chars[i]=='1') count++;
        }
        System.out.println(count);
        int y = 0;
        while(x!=0){
            x=(x-1)&x;
            y++;
        }
        System.out.println(y);
    }
}
